|
[ Intro ] [ Lesson1 ] [ Lesson2 ] [ Lesson3 ] [ Lesson4 ] [ Lesson5 ] [ Lesson6 ] [ Lesson7 ] [ Lesson8 ] |
||
|
Let us examine some more advanced functions with combinations of if (
) and while ( )
If "number" is less or equal to 8, the program will enter the function. The first line it sees there is "number = number + 1;" that basically means "increase the value of number by 1". Next, if "number" after the incresement happens to be equal to 3, the script pauses for 300 milliseconds. At the last, closing bracket for the while ( ) function, the program returns to the start of the same function and tries again if "number" is less or equal to 8. If it is larger than 8, it will not run through the while function again.Complex scripts may often contain many sub-functions in the functions to determine a precise situation and a sollution for such situation. Congratulations, if you mastered this part, you can continue reading Lesson 2. |
||
| Storm | ||